package com.pc.web.orders;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class OrdersDao {
	@Autowired
	private SqlSession sql;

	// 쓰기
	public void write(ReceiverBeans beans) {
		sql.insert("orders.write", beans);
	}

	// 무통장입금 읽기
	public ReceiverBeans read(String rcode) {
		return sql.selectOne("orders.read", rcode);
	}

	// 결제 읽기
	public ReceiverBeans payment(String rcode) {
		return sql.selectOne("orders.payment", rcode);
	}

	// 리스트(주문 배송 조회)
	public List<ReceiverBeans> list() {
		return sql.selectList("orders.list");

	}
	
	// 최근주문내역 읽기
	public ReceiverBeans view(String rcode) {
		return sql.selectOne("orders.view", rcode);
	}

}
